﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MockPrjTeam1.Biz;

namespace MockPrjTeam1.Pages.Views
{
    public partial class ListProgramme : System.Web.UI.Page
    {
        static ProgrammeBiz biz = new ProgrammeBiz();
        bool loaded = false;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (loaded == false)
            {
                GridView1.DataSource = biz.GetProgramme();
                GridView1.DataBind();
                loaded = true;
            }
        }



        protected void Button1_Click(object sender, EventArgs e)
        {
            GridView1.DataSource = biz.PreviousPage();
            GridView1.DataBind();
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            GridView1.DataSource = biz.NextPage();
            GridView1.DataBind();
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            if (loaded == false)
            {
                GridView1.DataSource = biz.GetProgramme();
                GridView1.DataBind();
                loaded = true;
            }
        }

    }
}